package com.lanou.service.impl;

import com.lanou.entity.TbContent;
import com.lanou.entity.TbContentExample;
import com.lanou.mapper.TbContentMapper;
import com.lanou.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by QuChao on 2018/11/25
 */
@Service
public class ContentServiceImpl implements ContentService {
    @Autowired
    private TbContentMapper tbContentMapper;

    @Override
    public List<TbContent> getContentsByCategoryId(Long id) {
        TbContentExample tbContentExample = new TbContentExample();
        tbContentExample.createCriteria().andCategoryIdEqualTo(id);
        return tbContentMapper.selectByExampleWithBLOBs(tbContentExample);
    }
}
